/*
 * MIT License
 *
 * Copyright (c) 2018 Aberic Yang
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: block/BlockHeader.proto

package cn.aberic.bother.entity.proto.block;

public final class BlockHeaderProto {
  private BlockHeaderProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface BlockHeaderOrBuilder extends
      // @@protoc_insertion_point(interface_extends:BlockHeader)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * 本次写入值链码hash
     * </pre>
     *
     * <code>string hash = 1;</code>
     */
    String getHash();
    /**
     * <pre>
     * 本次写入值链码hash
     * </pre>
     *
     * <code>string hash = 1;</code>
     */
    com.google.protobuf.ByteString
        getHashBytes();

    /**
     * <pre>
     * 区块高度
     * </pre>
     *
     * <code>int32 height = 2;</code>
     */
    int getHeight();

    /**
     * <pre>
     * 当前区块hash
     * </pre>
     *
     * <code>string currentDataHash = 3;</code>
     */
    String getCurrentDataHash();
    /**
     * <pre>
     * 当前区块hash
     * </pre>
     *
     * <code>string currentDataHash = 3;</code>
     */
    com.google.protobuf.ByteString
        getCurrentDataHashBytes();

    /**
     * <pre>
     * 上一区块hash
     * </pre>
     *
     * <code>string previousDataHash = 4;</code>
     */
    String getPreviousDataHash();
    /**
     * <pre>
     * 上一区块hash
     * </pre>
     *
     * <code>string previousDataHash = 4;</code>
     */
    com.google.protobuf.ByteString
        getPreviousDataHashBytes();

    /**
     * <pre>
     * 当前区块生成时间戳
     * </pre>
     *
     * <code>int64 timestamp = 5;</code>
     */
    long getTimestamp();

    /**
     * <pre>
     * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
     * </pre>
     *
     * <code>string time = 6;</code>
     */
    String getTime();
    /**
     * <pre>
     * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
     * </pre>
     *
     * <code>string time = 6;</code>
     */
    com.google.protobuf.ByteString
        getTimeBytes();
  }
  /**
   * Protobuf type {@code BlockHeader}
   */
  public  static final class BlockHeader extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:BlockHeader)
      BlockHeaderOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use BlockHeader.newBuilder() to construct.
    private BlockHeader(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private BlockHeader() {
      hash_ = "";
      height_ = 0;
      currentDataHash_ = "";
      previousDataHash_ = "";
      timestamp_ = 0L;
      time_ = "";
    }

    @Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private BlockHeader(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10: {
              String s = input.readStringRequireUtf8();

              hash_ = s;
              break;
            }
            case 16: {

              height_ = input.readInt32();
              break;
            }
            case 26: {
              String s = input.readStringRequireUtf8();

              currentDataHash_ = s;
              break;
            }
            case 34: {
              String s = input.readStringRequireUtf8();

              previousDataHash_ = s;
              break;
            }
            case 40: {

              timestamp_ = input.readInt64();
              break;
            }
            case 50: {
              String s = input.readStringRequireUtf8();

              time_ = s;
              break;
            }
            default: {
              if (!parseUnknownFieldProto3(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return BlockHeaderProto.internal_static_BlockHeader_descriptor;
    }

    @Override
    protected FieldAccessorTable
        internalGetFieldAccessorTable() {
      return BlockHeaderProto.internal_static_BlockHeader_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              BlockHeaderProto.BlockHeader.class, BlockHeaderProto.BlockHeader.Builder.class);
    }

    public static final int HASH_FIELD_NUMBER = 1;
    private volatile Object hash_;
    /**
     * <pre>
     * 本次写入值链码hash
     * </pre>
     *
     * <code>string hash = 1;</code>
     */
    public String getHash() {
      Object ref = hash_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        hash_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * 本次写入值链码hash
     * </pre>
     *
     * <code>string hash = 1;</code>
     */
    public com.google.protobuf.ByteString
        getHashBytes() {
      Object ref = hash_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (String) ref);
        hash_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int HEIGHT_FIELD_NUMBER = 2;
    private int height_;
    /**
     * <pre>
     * 区块高度
     * </pre>
     *
     * <code>int32 height = 2;</code>
     */
    public int getHeight() {
      return height_;
    }

    public static final int CURRENTDATAHASH_FIELD_NUMBER = 3;
    private volatile Object currentDataHash_;
    /**
     * <pre>
     * 当前区块hash
     * </pre>
     *
     * <code>string currentDataHash = 3;</code>
     */
    public String getCurrentDataHash() {
      Object ref = currentDataHash_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        currentDataHash_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * 当前区块hash
     * </pre>
     *
     * <code>string currentDataHash = 3;</code>
     */
    public com.google.protobuf.ByteString
        getCurrentDataHashBytes() {
      Object ref = currentDataHash_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (String) ref);
        currentDataHash_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PREVIOUSDATAHASH_FIELD_NUMBER = 4;
    private volatile Object previousDataHash_;
    /**
     * <pre>
     * 上一区块hash
     * </pre>
     *
     * <code>string previousDataHash = 4;</code>
     */
    public String getPreviousDataHash() {
      Object ref = previousDataHash_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        previousDataHash_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * 上一区块hash
     * </pre>
     *
     * <code>string previousDataHash = 4;</code>
     */
    public com.google.protobuf.ByteString
        getPreviousDataHashBytes() {
      Object ref = previousDataHash_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (String) ref);
        previousDataHash_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int TIMESTAMP_FIELD_NUMBER = 5;
    private long timestamp_;
    /**
     * <pre>
     * 当前区块生成时间戳
     * </pre>
     *
     * <code>int64 timestamp = 5;</code>
     */
    public long getTimestamp() {
      return timestamp_;
    }

    public static final int TIME_FIELD_NUMBER = 6;
    private volatile Object time_;
    /**
     * <pre>
     * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
     * </pre>
     *
     * <code>string time = 6;</code>
     */
    public String getTime() {
      Object ref = time_;
      if (ref instanceof String) {
        return (String) ref;
      } else {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        time_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
     * </pre>
     *
     * <code>string time = 6;</code>
     */
    public com.google.protobuf.ByteString
        getTimeBytes() {
      Object ref = time_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (String) ref);
        time_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private byte memoizedIsInitialized = -1;
    @Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getHashBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hash_);
      }
      if (height_ != 0) {
        output.writeInt32(2, height_);
      }
      if (!getCurrentDataHashBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, currentDataHash_);
      }
      if (!getPreviousDataHashBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 4, previousDataHash_);
      }
      if (timestamp_ != 0L) {
        output.writeInt64(5, timestamp_);
      }
      if (!getTimeBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 6, time_);
      }
      unknownFields.writeTo(output);
    }

    @Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getHashBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hash_);
      }
      if (height_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, height_);
      }
      if (!getCurrentDataHashBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, currentDataHash_);
      }
      if (!getPreviousDataHashBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, previousDataHash_);
      }
      if (timestamp_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(5, timestamp_);
      }
      if (!getTimeBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, time_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @Override
    public boolean equals(final Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof BlockHeaderProto.BlockHeader)) {
        return super.equals(obj);
      }
      BlockHeaderProto.BlockHeader other = (BlockHeaderProto.BlockHeader) obj;

      boolean result = true;
      result = result && getHash()
          .equals(other.getHash());
      result = result && (getHeight()
          == other.getHeight());
      result = result && getCurrentDataHash()
          .equals(other.getCurrentDataHash());
      result = result && getPreviousDataHash()
          .equals(other.getPreviousDataHash());
      result = result && (getTimestamp()
          == other.getTimestamp());
      result = result && getTime()
          .equals(other.getTime());
      result = result && unknownFields.equals(other.unknownFields);
      return result;
    }

    @Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + HASH_FIELD_NUMBER;
      hash = (53 * hash) + getHash().hashCode();
      hash = (37 * hash) + HEIGHT_FIELD_NUMBER;
      hash = (53 * hash) + getHeight();
      hash = (37 * hash) + CURRENTDATAHASH_FIELD_NUMBER;
      hash = (53 * hash) + getCurrentDataHash().hashCode();
      hash = (37 * hash) + PREVIOUSDATAHASH_FIELD_NUMBER;
      hash = (53 * hash) + getPreviousDataHash().hashCode();
      hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getTimestamp());
      hash = (37 * hash) + TIME_FIELD_NUMBER;
      hash = (53 * hash) + getTime().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static BlockHeaderProto.BlockHeader parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static BlockHeaderProto.BlockHeader parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static BlockHeaderProto.BlockHeader parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static BlockHeaderProto.BlockHeader parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(BlockHeaderProto.BlockHeader prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @Override
    protected Builder newBuilderForType(
        BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code BlockHeader}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:BlockHeader)
        BlockHeaderProto.BlockHeaderOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return BlockHeaderProto.internal_static_BlockHeader_descriptor;
      }

      @Override
      protected FieldAccessorTable
          internalGetFieldAccessorTable() {
        return BlockHeaderProto.internal_static_BlockHeader_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                BlockHeaderProto.BlockHeader.class, BlockHeaderProto.BlockHeader.Builder.class);
      }

      // Construct using cn.aberic.bother.entity.proto.block.BlockHeaderProto.BlockHeader.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      @Override
      public Builder clear() {
        super.clear();
        hash_ = "";

        height_ = 0;

        currentDataHash_ = "";

        previousDataHash_ = "";

        timestamp_ = 0L;

        time_ = "";

        return this;
      }

      @Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return BlockHeaderProto.internal_static_BlockHeader_descriptor;
      }

      @Override
      public BlockHeaderProto.BlockHeader getDefaultInstanceForType() {
        return BlockHeaderProto.BlockHeader.getDefaultInstance();
      }

      @Override
      public BlockHeaderProto.BlockHeader build() {
        BlockHeaderProto.BlockHeader result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @Override
      public BlockHeaderProto.BlockHeader buildPartial() {
        BlockHeaderProto.BlockHeader result = new BlockHeaderProto.BlockHeader(this);
        result.hash_ = hash_;
        result.height_ = height_;
        result.currentDataHash_ = currentDataHash_;
        result.previousDataHash_ = previousDataHash_;
        result.timestamp_ = timestamp_;
        result.time_ = time_;
        onBuilt();
        return result;
      }

      @Override
      public Builder clone() {
        return (Builder) super.clone();
      }
      @Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      @Override
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      @Override
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      @Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      @Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      @Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof BlockHeaderProto.BlockHeader) {
          return mergeFrom((BlockHeaderProto.BlockHeader)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(BlockHeaderProto.BlockHeader other) {
        if (other == BlockHeaderProto.BlockHeader.getDefaultInstance()) return this;
        if (!other.getHash().isEmpty()) {
          hash_ = other.hash_;
          onChanged();
        }
        if (other.getHeight() != 0) {
          setHeight(other.getHeight());
        }
        if (!other.getCurrentDataHash().isEmpty()) {
          currentDataHash_ = other.currentDataHash_;
          onChanged();
        }
        if (!other.getPreviousDataHash().isEmpty()) {
          previousDataHash_ = other.previousDataHash_;
          onChanged();
        }
        if (other.getTimestamp() != 0L) {
          setTimestamp(other.getTimestamp());
        }
        if (!other.getTime().isEmpty()) {
          time_ = other.time_;
          onChanged();
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @Override
      public final boolean isInitialized() {
        return true;
      }

      @Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        BlockHeaderProto.BlockHeader parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (BlockHeaderProto.BlockHeader) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private Object hash_ = "";
      /**
       * <pre>
       * 本次写入值链码hash
       * </pre>
       *
       * <code>string hash = 1;</code>
       */
      public String getHash() {
        Object ref = hash_;
        if (!(ref instanceof String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          String s = bs.toStringUtf8();
          hash_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      /**
       * <pre>
       * 本次写入值链码hash
       * </pre>
       *
       * <code>string hash = 1;</code>
       */
      public com.google.protobuf.ByteString
          getHashBytes() {
        Object ref = hash_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8(
                  (String) ref);
          hash_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * 本次写入值链码hash
       * </pre>
       *
       * <code>string hash = 1;</code>
       */
      public Builder setHash(
          String value) {
        if (value == null) {
    throw new NullPointerException();
  }

        hash_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 本次写入值链码hash
       * </pre>
       *
       * <code>string hash = 1;</code>
       */
      public Builder clearHash() {

        hash_ = getDefaultInstance().getHash();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 本次写入值链码hash
       * </pre>
       *
       * <code>string hash = 1;</code>
       */
      public Builder setHashBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

        hash_ = value;
        onChanged();
        return this;
      }

      private int height_ ;
      /**
       * <pre>
       * 区块高度
       * </pre>
       *
       * <code>int32 height = 2;</code>
       */
      public int getHeight() {
        return height_;
      }
      /**
       * <pre>
       * 区块高度
       * </pre>
       *
       * <code>int32 height = 2;</code>
       */
      public Builder setHeight(int value) {

        height_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 区块高度
       * </pre>
       *
       * <code>int32 height = 2;</code>
       */
      public Builder clearHeight() {

        height_ = 0;
        onChanged();
        return this;
      }

      private Object currentDataHash_ = "";
      /**
       * <pre>
       * 当前区块hash
       * </pre>
       *
       * <code>string currentDataHash = 3;</code>
       */
      public String getCurrentDataHash() {
        Object ref = currentDataHash_;
        if (!(ref instanceof String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          String s = bs.toStringUtf8();
          currentDataHash_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      /**
       * <pre>
       * 当前区块hash
       * </pre>
       *
       * <code>string currentDataHash = 3;</code>
       */
      public com.google.protobuf.ByteString
          getCurrentDataHashBytes() {
        Object ref = currentDataHash_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8(
                  (String) ref);
          currentDataHash_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * 当前区块hash
       * </pre>
       *
       * <code>string currentDataHash = 3;</code>
       */
      public Builder setCurrentDataHash(
          String value) {
        if (value == null) {
    throw new NullPointerException();
  }

        currentDataHash_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 当前区块hash
       * </pre>
       *
       * <code>string currentDataHash = 3;</code>
       */
      public Builder clearCurrentDataHash() {

        currentDataHash_ = getDefaultInstance().getCurrentDataHash();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 当前区块hash
       * </pre>
       *
       * <code>string currentDataHash = 3;</code>
       */
      public Builder setCurrentDataHashBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

        currentDataHash_ = value;
        onChanged();
        return this;
      }

      private Object previousDataHash_ = "";
      /**
       * <pre>
       * 上一区块hash
       * </pre>
       *
       * <code>string previousDataHash = 4;</code>
       */
      public String getPreviousDataHash() {
        Object ref = previousDataHash_;
        if (!(ref instanceof String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          String s = bs.toStringUtf8();
          previousDataHash_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      /**
       * <pre>
       * 上一区块hash
       * </pre>
       *
       * <code>string previousDataHash = 4;</code>
       */
      public com.google.protobuf.ByteString
          getPreviousDataHashBytes() {
        Object ref = previousDataHash_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8(
                  (String) ref);
          previousDataHash_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * 上一区块hash
       * </pre>
       *
       * <code>string previousDataHash = 4;</code>
       */
      public Builder setPreviousDataHash(
          String value) {
        if (value == null) {
    throw new NullPointerException();
  }

        previousDataHash_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 上一区块hash
       * </pre>
       *
       * <code>string previousDataHash = 4;</code>
       */
      public Builder clearPreviousDataHash() {

        previousDataHash_ = getDefaultInstance().getPreviousDataHash();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 上一区块hash
       * </pre>
       *
       * <code>string previousDataHash = 4;</code>
       */
      public Builder setPreviousDataHashBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

        previousDataHash_ = value;
        onChanged();
        return this;
      }

      private long timestamp_ ;
      /**
       * <pre>
       * 当前区块生成时间戳
       * </pre>
       *
       * <code>int64 timestamp = 5;</code>
       */
      public long getTimestamp() {
        return timestamp_;
      }
      /**
       * <pre>
       * 当前区块生成时间戳
       * </pre>
       *
       * <code>int64 timestamp = 5;</code>
       */
      public Builder setTimestamp(long value) {

        timestamp_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 当前区块生成时间戳
       * </pre>
       *
       * <code>int64 timestamp = 5;</code>
       */
      public Builder clearTimestamp() {

        timestamp_ = 0L;
        onChanged();
        return this;
      }

      private Object time_ = "";
      /**
       * <pre>
       * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
       * </pre>
       *
       * <code>string time = 6;</code>
       */
      public String getTime() {
        Object ref = time_;
        if (!(ref instanceof String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          String s = bs.toStringUtf8();
          time_ = s;
          return s;
        } else {
          return (String) ref;
        }
      }
      /**
       * <pre>
       * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
       * </pre>
       *
       * <code>string time = 6;</code>
       */
      public com.google.protobuf.ByteString
          getTimeBytes() {
        Object ref = time_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8(
                  (String) ref);
          time_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
       * </pre>
       *
       * <code>string time = 6;</code>
       */
      public Builder setTime(
          String value) {
        if (value == null) {
    throw new NullPointerException();
  }

        time_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
       * </pre>
       *
       * <code>string time = 6;</code>
       */
      public Builder clearTime() {

        time_ = getDefaultInstance().getTime();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 交易时间戳转字符串——yyyy/MM/dd HH:mm:ss
       * </pre>
       *
       * <code>string time = 6;</code>
       */
      public Builder setTimeBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

        time_ = value;
        onChanged();
        return this;
      }
      @Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

      @Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:BlockHeader)
    }

    // @@protoc_insertion_point(class_scope:BlockHeader)
    private static final BlockHeaderProto.BlockHeader DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new BlockHeaderProto.BlockHeader();
    }

    public static BlockHeaderProto.BlockHeader getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<BlockHeader>
        PARSER = new com.google.protobuf.AbstractParser<BlockHeader>() {
      @Override
      public BlockHeader parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new BlockHeader(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<BlockHeader> parser() {
      return PARSER;
    }

    @Override
    public com.google.protobuf.Parser<BlockHeader> getParserForType() {
      return PARSER;
    }

    @Override
    public BlockHeaderProto.BlockHeader getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_BlockHeader_descriptor;
  private static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_BlockHeader_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    String[] descriptorData = {
      "\n\027block/BlockHeader.proto\"\177\n\013BlockHeader" +
      "\022\014\n\004hash\030\001 \001(\t\022\016\n\006height\030\002 \001(\005\022\027\n\017curren" +
      "tDataHash\030\003 \001(\t\022\030\n\020previousDataHash\030\004 \001(" +
      "\t\022\021\n\ttimestamp\030\005 \001(\003\022\014\n\004time\030\006 \001(\tB7\n#cn" +
      ".aberic.bother.entity.proto.blockB\020Block" +
      "HeaderProtob\006proto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
    internal_static_BlockHeader_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_BlockHeader_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_BlockHeader_descriptor,
        new String[] { "Hash", "Height", "CurrentDataHash", "PreviousDataHash", "Timestamp", "Time", });
  }

  // @@protoc_insertion_point(outer_class_scope)
}
